/**
 * Author(s): xuming.Wong <xuming.Wong@gmail.com>
 */

#ifndef __LIGHT_COMPONENT_H__
#define __LIGHT_COMPONENT_H__

#include "Component.h"

namespace PQEngine
{
	/*The light component type.
	*/
	enum LightType
	{
		LIGHT_TYPE_POINT=Ogre::Light::LT_POINT,
		LIGHT_TYPE_DIRECTIONAL=Ogre::Light::LT_DIRECTIONAL,
		LIGHT_TYPE_SPOTLIGHT=Ogre::Light::LT_SPOTLIGHT,
	};

	/*The light component is a comonent to attach to light object.
	This class is used to control light properties.
	*/
	class LightComponent
		: public Component
	{
	public:
		LightComponent(Ogre::Light* light);
		inline Ogre::Light* getLight()
		{
			return _light;
		}

		void update(float deltaT);
		void setType(LightType type);
		void setDirection(const Ogre::Vector3& direction);
		void setDiffuseColor(const Ogre::ColourValue &color);
		void setSpecularColor(const Ogre::ColourValue &color);
	private:
		Ogre::Light* _light;
		Ogre::Light::LightTypes _lightType;
		Ogre::ColourValue _diffuseColor;
		Ogre::ColourValue _specularColor;
		Ogre::Real _intensity;
		Ogre::Vector3 _direction;
	};
}

#endif
